﻿using AutoMapper;
using BCVP.Net8.Model;

namespace BCVP.Net8.Extensions
{
  public class CustomProfile : Profile
  {
    /// <summary>
    /// 创建关系映射
    /// </summary>
    public CustomProfile()
    {
      CreateMap<User, UserVo>()
        .ForMember(a => a.UserName, o => o.MapFrom(d => d.Name));
      CreateMap<UserVo, User>()
        .ForMember(a => a.Name, o => o.MapFrom(d => d.UserName));
    }
  }
}
